<?php global $has_permit; ?>
<div class="std_header auto_height">
    <div class="left">
        <strong>Cấu hình hệ thống</strong>
    </div>
</div>
<div class="db_left bl">
    <?php $this->load->view('site/admin/side_block'); ?>
</div>
<div class="db_right bl">
    <?php if ($has_permit) :?>
    <div id="admin_management">
        <div class="mt_10">
            <?php $message = $this->load->view('site/admin/message', null, true); echo $message; ?>
        </div>
        <div id="tab_store" class="tab_container">
            <ul>
                <li id="active_tab_edit"><a href="#tab_edit"><span>Thông tin tài khoản</span></a></li>
                <li <?php if (isset($change_password)) :?>class="tabs-selected"<?php endif; ?> id="active_tab_password"><a href="#tab_password"><span>Thay đổi mật khẩu</span></a></li>
            </ul>
            <div id="tab_edit" <?php if (isset($change_password)) :?>class="tabs-hide"<?php endif; ?>>
                <form id="frm_admin_edit" method="POST" action="<?php echo $save_action; ?>">
                    <div class="clearfix auto_height mb_10">
                        <button class="gray_btn" type="submit"><span>Lưu lại thông tin</span></button>
                    </div>
                    <div class="form_block">
                        <div class="block_header">
                            Thông tin căn bản
                        </div>
                        <div class="block_content">
                            <table cellpadding="0px" cellspacing="0px">
                                <tr>
                                    <td class="frm_label">Họ tên(*)</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input required" name="data[name]" value="<?php echo get_field($admin, 'name'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Địa chỉ email(*)</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input required" name="data[email]" value="<?php echo get_field($admin, 'email'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Số điện thoại(*)</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input required" name="data[phone]" value="<?php echo get_field($admin, 'phone'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Yahoo ID</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input" name="data[yahoo_id]" value="<?php echo get_field($admin, 'yahoo_id'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Skype ID</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input" name="data[skype_id]" value="<?php echo get_field($admin, 'skype_id'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Facebook ID</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input" name="data[facebook_id]" value="<?php echo get_field($admin, 'facebook_id'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Điện thoại(*)</td>
                                    <td class="frm_field">
                                        <input type="text" class="std_input required" name="data[phone]" value="<?php echo get_field($admin, 'phone'); ?>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Giới thiệu</td>
                                    <td class="frm_field">
                                        <textarea name="data[about]"><?php echo get_field($admin, 'about'); ?></textarea>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="clearfix auto_height mb_10">
                        <button class="gray_btn" type="submit"><span>Lưu lại thông tin</span></button>
                    </div>
                </form>
            </div>
            <div id="tab_password">
                <form id="frm_admin_password" method="POST" action="<?php echo $change_password_action; ?>">
                    <?php echo $message; ?>
                    <div class="clearfix auto_height mb_10">
                        <button class="gray_btn" type="submit"><span>Lưu lại thông tin</span></button>
                    </div>
                    <div class="form_block">
                        <div class="block_header">
                            Thay đổi mật khẩu hiện tại của bạn
                        </div>
                        <div class="block_content">
                            <table cellpadding="0px" cellspacing="0px">
                                <tr>
                                    <td class="frm_label">Mật khẩu hiện tại(*)</td>
                                    <td class="frm_field">
                                        <input type="password" class="std_input required" name="data[current_password]" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Mật khẩu mới(*)</td>
                                    <td class="frm_field">
                                        <input type="password" class="std_input required" name="data[password]" value="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="frm_label">Xác nhận mật khẩu mới(*)</td>
                                    <td class="frm_field">
                                        <input type="password" class="std_input required" name="data[confirm_password]" value="" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="clearfix auto_height mb_10">
                        <button class="gray_btn" type="submit"><span>Lưu lại thông tin</span></button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <?php else :?>
    <?php $this->load->view('layouts/restricted'); ?>
    <?php endif; ?>
</div>
<div class="clearfix"></div>